<%@ page import="java.util.*" contentType="text/html;charset=UTF-8" %>
<%@ page language="java" import="com.bean.*" %>
<%@ page language="java" import="com.jdbc.util.*" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>学生选课信息表</title>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/index.css">
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/role.css">
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/table.css">
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/SelectCourseSystem.js"></script>
</head>
<body>
<div class="contain">
    <%@ include file="loginHead.jsp" %>
    <%@ include file="studentNavigate.jsp" %>
    <%
        StudentSelectDB studentSelectDB = new StudentSelectDB();
        studentSelectDB.getConnection();
        List<Course> courseList = studentSelectDB.findAllSelectCourse(userName);
        TimePlanUtil timePlanUtil = new TimePlanUtil();
    %>
    <form action="${pageContext.request.contextPath}/SelectCourseServlet" method="post">
        <table class="table" border="1" cellPadding="10" cellSpacing="0">
            <tr>
                <th class="tableHead" colspan="7">我的课表</th>
            </tr>
            <tr>
                <th>课程编号</th>
                <th>课程名称</th>
                <th>任课教师</th>
                <th>课程学分</th>
                <th>开始时间</th>
                <th>结束时间</th>
                <th>上课地点</th>
            </tr>
            <%
                for (Course course : courseList) {

            %>
            <tr>
                <td><%=course.getCourseId()%>
                </td>
                <td><%=course.getCourseName()%>
                </td>
                <td><%=course.getTeacher()%>
                </td>
                <td><%=course.getPoint()%>
                </td>
                <td><%=timePlanUtil.transform(course.getTime1())%>
                </td>
                <td><%=timePlanUtil.transform(course.getTime2())%>
                </td>
                <td><%=course.getLocation()%>
                </td>
            </tr>
            <%
                }
                studentSelectDB.release();
            %>
        </table>
        <%--                <input type="submit" value="返回选课页面">--%>
        <div class="selectBtn">
            <button id="selectBtn">返回选课页面</button>
        </div>
    </form>
</div>

</body>
</html>